package com.d0327;

import java.io.*;

public class Test {
    public static void main(String[] args) throws FileNotFoundException {
        FileReader fr=new FileReader(new File("src/com/d0327/a.txt"));
        BufferedReader br=new BufferedReader(fr);
        String str="";
        try {
            str=br.readLine();
            String[] str1=str.split(" ");
            int []num=new int[str1.length];
            for (String s:
                 str1) {
                for(int i=0;i<str1.length;i++){
                    if(s.equals(str1[i])){
                        num[i]++;
                    }
                }
            }
            for(int k=0;k<str1.length;k++){
                if(num[k]!=0){
                    System.out.println("单词名称:"+str1[k]+"个数:"+num[k]);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
